3.907 \(\int x (a+b x)^n (c+d x) \, dx\)

Optimal. Leaf size=74 \[ -\frac{a (b c-a d) (a+b x)^{n+1}}{b^3 (n+1)}+\frac{(b c-2 a d) (a+b x)^{n+2}}{b^3 (n+2)}+\frac{d (a+b x)^{n+3}}{b^3 (n+3)} \]

[Out]

-((a*(b*c - a*d)*(a + b*x)^(1 + n))/(b^3*(1 + n))) + ((b*c - 2*a*d)*(a + b*x)^(2
 + n))/(b^3*(2 + n)) + (d*(a + b*x)^(3 + n))/(b^3*(3 + n))

_______________________________________________________________________________________

Rubi [A]  time = 0.0877288, antiderivative size = 74, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.071 \[ -\frac{a (b c-a d) (a+b x)^{n+1}}{b^3 (n+1)}+\frac{(b c-2 a d) (a+b x)^{n+2}}{b^3 (n+2)}+\frac{d (a+b x)^{n+3}}{b^3 (n+3)} \]

Antiderivative was successfully verified.

[In]  Int[x*(a + b*x)^n*(c + d*x),x]

[Out]

-((a*(b*c - a*d)*(a + b*x)^(1 + n))/(b^3*(1 + n))) + ((b*c - 2*a*d)*(a + b*x)^(2
 + n))/(b^3*(2 + n)) + (d*(a + b*x)^(3 + n))/(b^3*(3 + n))

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 15.9591, size = 63, normalized size = 0.85 \[ \frac{a \left (a + b x\right )^{n + 1} \left (a d - b c\right )}{b^{3} \left (n + 1\right )} + \frac{d \left (a + b x\right )^{n + 3}}{b^{3} \left (n + 3\right )} - \frac{\left (a + b x\right )^{n + 2} \left (2 a d - b c\right )}{b^{3} \left (n + 2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(x*(b*x+a)**n*(d*x+c),x)

[Out]

a*(a + b*x)**(n + 1)*(a*d - b*c)/(b**3*(n + 1)) + d*(a + b*x)**(n + 3)/(b**3*(n
+ 3)) - (a + b*x)**(n + 2)*(2*a*d - b*c)/(b**3*(n + 2))

_______________________________________________________________________________________

Mathematica [A]  time = 0.0713217, size = 72, normalized size = 0.97 \[ \frac{(a+b x)^{n+1} \left (2 a^2 d-a b (c (n+3)+2 d (n+1) x)+b^2 (n+1) x (c (n+3)+d (n+2) x)\right )}{b^3 (n+1) (n+2) (n+3)} \]

Antiderivative was successfully verified.

[In]  Integrate[x*(a + b*x)^n*(c + d*x),x]

[Out]

((a + b*x)^(1 + n)*(2*a^2*d - a*b*(c*(3 + n) + 2*d*(1 + n)*x) + b^2*(1 + n)*x*(c
*(3 + n) + d*(2 + n)*x)))/(b^3*(1 + n)*(2 + n)*(3 + n))

_______________________________________________________________________________________

Maple [A]  time = 0.007, size = 114, normalized size = 1.5 \[{\frac{ \left ( bx+a \right ) ^{1+n} \left ({b}^{2}d{n}^{2}{x}^{2}+{b}^{2}c{n}^{2}x+3\,{b}^{2}dn{x}^{2}-2\,abdnx+4\,{b}^{2}cnx+2\,d{x}^{2}{b}^{2}-abcn-2\,abdx+3\,{b}^{2}cx+2\,{a}^{2}d-3\,abc \right ) }{{b}^{3} \left ({n}^{3}+6\,{n}^{2}+11\,n+6 \right ) }} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(x*(b*x+a)^n*(d*x+c),x)

[Out]

(b*x+a)^(1+n)*(b^2*d*n^2*x^2+b^2*c*n^2*x+3*b^2*d*n*x^2-2*a*b*d*n*x+4*b^2*c*n*x+2
*b^2*d*x^2-a*b*c*n-2*a*b*d*x+3*b^2*c*x+2*a^2*d-3*a*b*c)/b^3/(n^3+6*n^2+11*n+6)

_______________________________________________________________________________________

Maxima [A]  time = 1.36563, size = 153, normalized size = 2.07 \[ \frac{{\left (b^{2}{\left (n + 1\right )} x^{2} + a b n x - a^{2}\right )}{\left (b x + a\right )}^{n} c}{{\left (n^{2} + 3 \, n + 2\right )} b^{2}} + \frac{{\left ({\left (n^{2} + 3 \, n + 2\right )} b^{3} x^{3} +{\left (n^{2} + n\right )} a b^{2} x^{2} - 2 \, a^{2} b n x + 2 \, a^{3}\right )}{\left (b x + a\right )}^{n} d}{{\left (n^{3} + 6 \, n^{2} + 11 \, n + 6\right )} b^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((d*x + c)*(b*x + a)^n*x,x, algorithm="maxima")

[Out]

(b^2*(n + 1)*x^2 + a*b*n*x - a^2)*(b*x + a)^n*c/((n^2 + 3*n + 2)*b^2) + ((n^2 +
3*n + 2)*b^3*x^3 + (n^2 + n)*a*b^2*x^2 - 2*a^2*b*n*x + 2*a^3)*(b*x + a)^n*d/((n^
3 + 6*n^2 + 11*n + 6)*b^3)

_______________________________________________________________________________________

Fricas [A]  time = 0.228417, size = 215, normalized size = 2.91 \[ -\frac{{\left (a^{2} b c n + 3 \, a^{2} b c - 2 \, a^{3} d -{\left (b^{3} d n^{2} + 3 \, b^{3} d n + 2 \, b^{3} d\right )} x^{3} -{\left (3 \, b^{3} c +{\left (b^{3} c + a b^{2} d\right )} n^{2} +{\left (4 \, b^{3} c + a b^{2} d\right )} n\right )} x^{2} -{\left (a b^{2} c n^{2} +{\left (3 \, a b^{2} c - 2 \, a^{2} b d\right )} n\right )} x\right )}{\left (b x + a\right )}^{n}}{b^{3} n^{3} + 6 \, b^{3} n^{2} + 11 \, b^{3} n + 6 \, b^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((d*x + c)*(b*x + a)^n*x,x, algorithm="fricas")

[Out]

-(a^2*b*c*n + 3*a^2*b*c - 2*a^3*d - (b^3*d*n^2 + 3*b^3*d*n + 2*b^3*d)*x^3 - (3*b
^3*c + (b^3*c + a*b^2*d)*n^2 + (4*b^3*c + a*b^2*d)*n)*x^2 - (a*b^2*c*n^2 + (3*a*
b^2*c - 2*a^2*b*d)*n)*x)*(b*x + a)^n/(b^3*n^3 + 6*b^3*n^2 + 11*b^3*n + 6*b^3)

_______________________________________________________________________________________

Sympy [A]  time = 4.62855, size = 1090, normalized size = 14.73 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(x*(b*x+a)**n*(d*x+c),x)

[Out]

Piecewise((a**n*(c*x**2/2 + d*x**3/3), Eq(b, 0)), (2*a**3*d*log(a/b + x)/(2*a**3
*b**3 + 4*a**2*b**4*x + 2*a*b**5*x**2) + a**3*d/(2*a**3*b**3 + 4*a**2*b**4*x + 2
*a*b**5*x**2) + 4*a**2*b*d*x*log(a/b + x)/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b**
5*x**2) + 2*a*b**2*d*x**2*log(a/b + x)/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b**5*x
**2) - 2*a*b**2*d*x**2/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b**5*x**2) + b**3*c*x*
*2/(2*a**3*b**3 + 4*a**2*b**4*x + 2*a*b**5*x**2), Eq(n, -3)), (-2*a**2*d*log(a/b
 + x)/(a*b**3 + b**4*x) - 2*a**2*d/(a*b**3 + b**4*x) + a*b*c*log(a/b + x)/(a*b**
3 + b**4*x) + a*b*c/(a*b**3 + b**4*x) - 2*a*b*d*x*log(a/b + x)/(a*b**3 + b**4*x)
 + b**2*c*x*log(a/b + x)/(a*b**3 + b**4*x) + b**2*d*x**2/(a*b**3 + b**4*x), Eq(n
, -2)), (a**2*d*log(a/b + x)/b**3 - a*c*log(a/b + x)/b**2 - a*d*x/b**2 + c*x/b +
 d*x**2/(2*b), Eq(n, -1)), (2*a**3*d*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*
b**3*n + 6*b**3) - a**2*b*c*n*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n
+ 6*b**3) - 3*a**2*b*c*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**
3) - 2*a**2*b*d*n*x*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3)
+ a*b**2*c*n**2*x*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) +
3*a*b**2*c*n*x*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) + a*b
**2*d*n**2*x**2*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) + a*
b**2*d*n*x**2*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) + b**3
*c*n**2*x**2*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) + 4*b**
3*c*n*x**2*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) + 3*b**3*
c*x**2*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) + b**3*d*n**2
*x**3*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) + 3*b**3*d*n*x
**3*(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3) + 2*b**3*d*x**3*
(a + b*x)**n/(b**3*n**3 + 6*b**3*n**2 + 11*b**3*n + 6*b**3), True))

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.237385, size = 389, normalized size = 5.26 \[ \frac{b^{3} d n^{2} x^{3} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + b^{3} c n^{2} x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + a b^{2} d n^{2} x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 3 \, b^{3} d n x^{3} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + a b^{2} c n^{2} x e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 4 \, b^{3} c n x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + a b^{2} d n x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 2 \, b^{3} d x^{3} e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 3 \, a b^{2} c n x e^{\left (n{\rm ln}\left (b x + a\right )\right )} - 2 \, a^{2} b d n x e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 3 \, b^{3} c x^{2} e^{\left (n{\rm ln}\left (b x + a\right )\right )} - a^{2} b c n e^{\left (n{\rm ln}\left (b x + a\right )\right )} - 3 \, a^{2} b c e^{\left (n{\rm ln}\left (b x + a\right )\right )} + 2 \, a^{3} d e^{\left (n{\rm ln}\left (b x + a\right )\right )}}{b^{3} n^{3} + 6 \, b^{3} n^{2} + 11 \, b^{3} n + 6 \, b^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((d*x + c)*(b*x + a)^n*x,x, algorithm="giac")

[Out]

(b^3*d*n^2*x^3*e^(n*ln(b*x + a)) + b^3*c*n^2*x^2*e^(n*ln(b*x + a)) + a*b^2*d*n^2
*x^2*e^(n*ln(b*x + a)) + 3*b^3*d*n*x^3*e^(n*ln(b*x + a)) + a*b^2*c*n^2*x*e^(n*ln
(b*x + a)) + 4*b^3*c*n*x^2*e^(n*ln(b*x + a)) + a*b^2*d*n*x^2*e^(n*ln(b*x + a)) +
 2*b^3*d*x^3*e^(n*ln(b*x + a)) + 3*a*b^2*c*n*x*e^(n*ln(b*x + a)) - 2*a^2*b*d*n*x
*e^(n*ln(b*x + a)) + 3*b^3*c*x^2*e^(n*ln(b*x + a)) - a^2*b*c*n*e^(n*ln(b*x + a))
 - 3*a^2*b*c*e^(n*ln(b*x + a)) + 2*a^3*d*e^(n*ln(b*x + a)))/(b^3*n^3 + 6*b^3*n^2
 + 11*b^3*n + 6*b^3)